package com.springboot.autoconfigure.oss.config;

import com.springboot.autoconfigure.oss.annontion.RequiredFiled;
import com.springboot.autoconfigure.oss.service.OssApiService;
import com.springboot.autoconfigure.oss.service.impl.AliyunOssApiServiceImpl;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;

import javax.annotation.PostConstruct;

@Data
@Accessors(chain = true)
@Configuration
@ConfigurationProperties(prefix = "oss.aliyun")
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class AliyunOSSPropertis extends AbstractOSSPropertis {
    @RequiredFiled
    private String endpoint;
    @RequiredFiled
    private String accessKeyId;
    @RequiredFiled
    private String accessKeySecret;
    @RequiredFiled
    private String bucketName;
    private String extranet;

    @Override
    public Class getImpl() {
        return AliyunOssApiServiceImpl.class;
    }
}
